package partage;

import java.text.DateFormat;
import java.text.ParseException;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.sun.jmx.snmp.Timestamp;

public class GestionDate {
	public static SimpleDateFormat formatter = new SimpleDateFormat("dd-mm-yyyy");
    
	public static Date stringToDate(String sDate) throws ParseException {
	        return formatter.parse(sDate);
	}
	public static Timestamp toDBDateFormat(String sDate) throws ParseException {
	        return new Timestamp(stringToDate(sDate).getTime());
	}
	
	public static String now() {
	    Date date = new Date();
	    return formatter.format(date);
	  }
}
